package com.zhl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author zhl
 * @Title: ExportBootApplication
 * @Description TODO
 * @date： 2020/8/3 10:44
 * @version： V1.0
 */
@SpringBootApplication
@Slf4j
public class ExportBootApplication {

    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext application = SpringApplication.run(ExportBootApplication.class, args);
        Environment env = application.getEnvironment();
        String ip = InetAddress.getLocalHost().getHostAddress();
        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        String localPath = env.getProperty("report.localPath.temp");
        String cron = env.getProperty("scheduled.cron");
        log.info("\n----------------------------------------------------------\n\t" +
                "Application Export-Boot is running! Access URLs:\n\t" +
                "Local: \t\thttp://localhost:" + port + path + "/\n\t" +
                "External: \thttp://" + ip + ":" + port + path + "/\n\t" +
                "----------------------------------------------------------");
        log.info("导出excel本地存储路径为============="+localPath);
        log.info("定时cron表达式为============="+cron);
    }

}
